/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function deleteUser() {
            if($("#IdUser").prop("checked"))
            {
            
            document.getElementById('warning').innerHTML = "";
            document.getElementById("mainForm").action = "DeleteUser";
            document.getElementById("mainForm").submit();
            return true;
        }
        else{
            document.getElementById('warning').innerHTML = 'Please choose user';
            return false;
        }
        }
        
        function addUser() {
            document.getElementById("mainForm").action = "add_user.jsp";
            document.getElementById("mainForm").submit();
        }

        function editUser() {
            if($("#IdUser").prop("checked"))
            {
          
            document.getElementById('warning').innerHTML = "";
            document.getElementById("mainForm").action = "UpdateUser";
            document.getElementById("mainForm").submit();
            return true;
        }
        else{
            document.getElementById('warning').innerHTML = 'Please choose user';
            return false;
        }
            
        }
        function refreshUsers() {
            document.getElementById("mainForm").action = "Refresh";
            document.getElementById("mainForm").submit();
        }
        
        function checkFind(){


        if($('#keyword').val().match(/^[a-z]+$/i)){
           // alert($('#keyword').val());
            $('#warningFind').html('');
           // alert('good');
            return true;
        }
        else{

          $('#warningFind').html('Input user surname or name!');
           //  alert('Input user surname or name!');
           
            return false;
        }
  
}








   
   